# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kmediaplayer
pkgver=5.95.0
pkgrel=0
pkgdesc="Media player framework for KDE 5"
# riscv64 disabled due to missing rust in recursive dependency
arch="all !armhf !s390x !riscv64" # armhf blocked by extra-cmake-modules and s390x blocked by polkit
url="https://community.kde.org/Frameworks"
license="X11 AND LGPL-2.1-or-later"
depends_dev="qt5-qtbase-dev kparts-dev kxmlgui-dev"
makedepends="$depends_dev extra-cmake-modules samurai"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/portingAids/kmediaplayer-$pkgver.tar.xz"
subpackages="$pkgname-dev"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	# viewtest requires X11 to be running
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
94d591cbcc751c24b65bdd7c9b6a983f23a06e0b8ee2e10e6993abbe768dd85186c61f4b860da973c8c8a8cfdc8f24fcdf5f3c99b34bcc5b931a0b26dbb6892f  kmediaplayer-5.95.0.tar.xz
"
